#ifndef _VECTOR3_H__
#define _VECTOR3_H__

#include<d3dx10.h>

class Vector3 : public D3DXVECTOR3
{
public:
	inline float Length() { return D3DXVec3Length(this); }
	inline Vector3 *Normalize() { return static_cast<Vector3 *>(D3DXVec3Normalize(this, this)); }
	inline float Dot(const Vector3 &b) { return D3DXVec3Dot(this, &b); }
	inline Vector3 Cross(const Vector3 &b) const { Vector3 out; D3DXVec3Cross(&out, this, &b); return out; }
	inline float Distance(Vector3* v) {return sqrt(((this->x - v->x) * (this->x - v->x)) + ((this->y - v->y) * (this->y - v->y)) + ((this->z - v->z) * (this->z - v->z)));}
	static Vector3 Zero() { return Vector3(0.0f, 0.0f, 0.0f); }
	static Vector3 Up() { return Vector3(0.0f, 1.0f, 0.0f); }
	static Vector3 Right() { return Vector3(1.0f, 0.0f, 0.0f); }
	static Vector3 Forward() { return Vector3(0.0f, 0.0f, 1.0f); }

	Vector3(D3DXVECTOR3 &v3) { x = v3.x; y = v3.y; z = v3.z; }
	Vector3() : D3DXVECTOR3() { }
	Vector3(const float _x, const float _y, const float _z) { x = _x; y = _y; z = _z; }
};

#endif